/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow: auto;
}

/* CSS变量 - 浅色主题 */
:root {
    --primary-color: #007acc;
    --primary-hover: #005a9e;
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-color: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #dee2e6;
    --border-light: #e9ecef;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

/* 米黄主题 */
[data-theme="warm"] {
    --primary-color: #d4691a;
    --primary-hover: #b8571a;
    --bg-color: #fefcf8;
    --bg-secondary: #f7f3ed;
    --bg-tertiary: #ede7db;
    --text-color: #4a3728;
    --text-secondary: #6b5344;
    --text-muted: #8b7355;
    --border-color: #d4c4a8;
    --border-light: #e2d5c1;
    --splash-bg-start: #d4691a;
    --splash-bg-end: #b8571a;
}

/* 启动画面 */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--splash-bg-start, var(--primary-color)), var(--splash-bg-end, var(--primary-hover)));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.splash-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.splash-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.splash-content h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin: 0 auto 1rem;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: white;
    border-radius: 2px;
    animation: loading 2s ease-in-out infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* 主应用布局 */
.main-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 工具栏 */
.toolbar {
    height: 48px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 按钮样式 */
.btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
}

.btn-icon {
    padding: 6px 8px;
    min-width: auto;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

.icon {
    font-size: 14px;
}

/* 主题选择器 */
.theme-selector {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 12px;
}

/* 主容器 */
.main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 200px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: 48px;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.sidebar.collapsed .sidebar-header h3 {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 12px;
}

.nav-item:hover {
    background: var(--bg-tertiary);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-icon {
    font-size: 16px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.nav-text {
    font-size: 13px;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-text {
    display: none;
}

/* 内容区域 */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* 标签页 */
.tabs-header {
    height: 40px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    overflow-x: auto;
}

.tabs-list {
    display: flex;
    height: 100%;
}

.tab {
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: var(--bg-color);
    border-right: 1px solid var(--border-color);
    cursor: pointer;
    min-width: 120px;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.tab:hover {
    background: var(--bg-tertiary);
}

.tab.active {
    background: var(--bg-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-title {
    font-size: 13px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.tab-close:hover {
    background: var(--danger-color);
    color: white;
}

/* 面板 */
.panel {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.panel.active {
    display: flex;
}

.panel-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* HTTP请求面板 */
#http-panel {
    flex-direction: column;
    display: none;
}

#http-panel.active {
    display: flex;
}

/* 确保标签栏在非HTTP面板时隐藏 */
#http-panel:not(.active) .tabs-header {
    display: none !important;
}

/* 更强制的隐藏规则 */
body:not([data-current-panel="http"]) .tabs-header {
    display: none !important;
}

.request-section {
    flex: 1;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    overflow-y: auto;
}

.request-line {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}

.method-select {
    width: 100px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
}

.url-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-color);
    color: var(--text-color);
    resize: none;
    overflow: hidden;
    transition: height 0.2s ease;
    height: 36px;
    line-height: 1.4;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.send-btn {
    padding: 8px 24px;
    font-weight: 600;
}

/* 请求选项 */
.request-options {
    margin-top: 16px;
}

.options-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.option-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.option-tab:hover {
    color: var(--text-color);
}

.option-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.option-panel {
    display: none;
}

.option-panel.active {
    display: block;
}

/* 请求头表格 */
.headers-table,
.params-table {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 1fr 80px;
    gap: 1px;
    background: var(--bg-secondary);
    padding: 8px;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
}

.table-body {
    padding: 8px;
}

.header-row,
.param-row {
    display: grid;
    grid-template-columns: 1fr 1fr 80px;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.header-key,
.header-value,
.param-key,
.param-value {
    padding: 6px 8px;
    border: 1px solid var(--border-light);
    border-radius: 3px;
    font-size: 13px;
    background: var(--bg-color);
    color: var(--text-color);
}

.header-key:focus,
.header-value:focus,
.param-key:focus,
.param-value:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-remove {
    padding: 4px 8px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.btn-remove:hover {
    background: #c82333;
}

/* 请求体编辑器 */
.body-type-selector {
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
}

.body-type-selector label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    cursor: pointer;
}

.body-editor {
    position: relative;
}

#body-textarea {
    width: 100%;
    height: 200px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    resize: vertical;
    background: var(--bg-color);
    color: var(--text-color);
}

#body-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 高级选项 */
.advanced-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

/* 高级选项滚动条样式 */
.advanced-options::-webkit-scrollbar {
    width: 6px;
}

.advanced-options::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.advanced-options::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.advanced-options::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.option-group {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
}

.option-group h4 {
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 14px;
}

.option-item {
    margin-bottom: 12px;
}

.option-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 8px;
    cursor: pointer;
}

.sub-options {
    display: flex;
    gap: 8px;
    margin-left: 24px;
    flex-wrap: wrap;
}

.sub-options input,
.sub-options select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 12px;
    background: var(--bg-color);
    color: var(--text-color);
}

.sm4-config {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.sm4-config input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 13px;
    background: var(--bg-color);
    color: var(--text-color);
}

/* 响应区域 */
.response-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow: hidden;
    margin-bottom: 24px;
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.response-header h3 {
    font-size: 16px;
    color: var(--text-color);
}

.response-stats {
    display: flex;
    gap: 8px;
    align-items: center;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.success {
    background: var(--success-color);
    color: white;
}

.status-badge.error {
    background: var(--danger-color);
    color: white;
}

.time-badge {
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-secondary);
}

.response-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.response-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.response-tab:hover {
    color: var(--text-color);
}

.response-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.response-panel {
    flex: 1;
    display: none;
    overflow: hidden;
}

.response-panel.active {
    display: flex;
    flex-direction: column;
}

.response-content {
    flex: 1;
    overflow: auto;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    max-height: 400px;
}

.response-content pre {
    padding: 16px;
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-color);
}

/* 配置面板 */
.config-section {
    margin-bottom: 24px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
}

.config-section h3 {
    margin-bottom: 16px;
    color: var(--text-color);
    font-size: 16px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
}

.config-description {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

.global-headers-container {
    margin-top: 10px;
}

.global-headers-container .headers-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.global-headers-container .table-header {
    display: flex;
    background-color: var(--background-secondary);
    font-weight: bold;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

.global-headers-container .table-body {
    display: flex;
    flex-direction: column;
}

.global-headers-container .header-row {
    display: flex;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.global-headers-container .header-row:last-child {
    border-bottom: none;
}

.global-headers-container .col-key {
    flex: 1;
}

.global-headers-container .col-value {
    flex: 2;
}

.global-headers-container .col-action {
    width: 80px;
}

.global-headers-container .header-key,
.global-headers-container .header-value {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background-primary);
    color: var(--text-primary);
    margin-right: 8px;
}

.global-headers-container .header-key {
    flex: 1;
}

.global-headers-container .header-value {
    flex: 2;
}

.global-headers-container .btn-remove {
    padding: 6px 12px;
    background-color: var(--error-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.global-headers-container .btn-remove:hover {
    background-color: #d32f2f;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    background: var(--bg-color);
    color: var(--text-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.form-group textarea {
    height: 100px;
    resize: vertical;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.algorithm-description {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.algorithm-description p {
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.code-editor textarea {
    width: 100%;
    height: 300px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
    resize: both;
    min-height: 200px;
    min-width: 100%;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: 80vw;
    max-width: 1600px;
    min-width: 400px;
    margin: 0 auto;
    background: var(--bg-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 响应式设计 */

/* 分组管理相关样式 */
.manage-groups-container {
    min-height: 300px;
}

.groups-list {
    margin-bottom: 20px;
}

.group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

.group-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.group-info {
    flex: 1;
}

.group-name {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
}

.group-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.group-actions {
    display: flex;
    gap: 8px;
}

.group-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
    min-width: auto;
}

.add-group-container,
.edit-group-container,
.delete-group-container {
    padding: 20px 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.delete-group-info {
    margin-bottom: 20px;
}

.delete-group-info p {
    margin-bottom: 12px;
    color: var(--text-color);
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

[data-theme="dark"] .alert-warning {
    background-color: #332701;
    border-color: #664d03;
    color: #ffecb5;
}

.alert strong {
    font-weight: 600;
}

/* 空状态样式 */
.empty-groups {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-groups p {
    margin-bottom: 16px;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 48px;
    }
    
    .sidebar .nav-text {
        display: none;
    }
    
    .request-line {
        flex-direction: column;
        gap: 8px;
    }
    
    .method-select {
        width: 100%;
    }
    
    .sub-options {
        flex-direction: column;
        margin-left: 0;
    }
    
    .sm4-config {
        flex-direction: column;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-color);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    border-color: var(--text-secondary);
}

/* 可折叠配置区域 */
.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0;
}

.config-header:hover {
    background: var(--bg-secondary);
    margin: 0 -16px;
    padding: 8px 16px;
    border-radius: 4px;
}

.config-header h3 {
    margin: 0;
    font-size: 14px;
    color: var(--text-color);
}

.toggle-icon {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    user-select: none;
}

.config-content {
    padding-top: 12px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
        padding-top: 12px;
    }
}

/* 配置标签页样式 */
.config-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    gap: 2px;
}

.config-tab {
    padding: 10px 20px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none;
}

.config-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-color);
}

.config-tab.active {
    background: var(--bg-color);
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: -1px;
}

.config-tab-content {
    display: none;
    padding: 0 4px;
}

.config-tab-content.active {
    display: block;
}

/* SM4加密界面布局 */
.sm4-io-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: stretch;
    margin-top: 16px;
    height: calc(100vh - 300px); /* 基础高度，会根据密钥配置调整 */
    min-height: 300px;
}

/* 当密钥配置展开时调整高度 */
.config-section:has(.config-content[style*="block"]) + .config-section .sm4-io-container,
.config-content[style*="block"] ~ * .sm4-io-container {
    height: calc(100vh - 450px);
}

.sm4-input-section,
.sm4-output-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sm4-input-section .form-group,
.sm4-output-section .form-group {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
}

.sm4-input-section textarea,
.sm4-output-section textarea {
    flex: 1;
    resize: none;
    min-height: 200px;
}

.sm4-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 0;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.button-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.button-group-vertical .btn {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
}

.button-group-vertical .btn .icon {
    margin-right: 6px;
}

/* 签名状态显示 */
.signature-status {
    margin-top: 8px;
    padding: 4px 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    border-left: 3px solid var(--text-muted);
}

.signature-status small {
    font-size: 11px;
    color: var(--text-muted);
}

/* JSON编辑器增强 */
.json-format-btn {
    margin-top: 8px;
    background: var(--info-color);
    color: white;
    border-color: var(--info-color);
}

.json-format-btn:hover {
    background: #138496;
    border-color: #138496;
}

.body-editor {
    position: relative;
}

#body-textarea {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.4;
    tab-size: 2;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .sm4-io-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .sm4-controls {
        padding: 16px 0;
    }
    
    .button-group-vertical {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .button-group-vertical .btn {
        flex: 1;
        min-width: 100px;
    }
}

/* 工具提示 */
[title] {
    position: relative;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}/* 标签页文件
列表样式 */
.tab-files-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.tab-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
}

.tab-file-item:hover {
    background-color: var(--bg-secondary);
}

.tab-file-item:last-child {
    border-bottom: none;
}

.tab-file-content {
    flex: 1;
    cursor: pointer;
}

.tab-file-actions {
    margin-left: 12px;
}

.tab-file-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 4px;
}

.tab-file-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.tab-file-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 隐藏模态框确定按钮 */
#modal-confirm {
    display: none !important;
}

/* 模态框头部带操作按钮的样式 */
.modal-header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header-with-actions h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
}

.modal-header-with-actions .btn {
    margin: 0;
}

/* 历史记录样式 */
.url-history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
}

.history-item:hover {
    background-color: var(--bg-secondary);
}

.history-item:last-child {
    border-bottom: none;
}

.history-item-content {
    flex: 1;
    cursor: pointer;
}

.history-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.history-item-method {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

.history-item-method.get {
    background-color: var(--success-color);
}

.history-item-method.post {
    background-color: var(--warning-color);
    color: var(--text-color);
}

.history-item-method.put {
    background-color: var(--info-color);
}

.history-item-method.delete {
    background-color: var(--danger-color);
}

.history-item-method.patch {
    background-color: var(--primary-color);
}

.history-item-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 13px;
}

.history-item-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

.history-item-url {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
    word-break: break-all;
}

.history-item-processed {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 2px;
}

.history-item-options {
    font-size: 10px;
    color: var(--primary-color);
    background-color: var(--bg-tertiary);
    padding: 1px 4px;
    border-radius: 2px;
    display: inline-block;
}

.history-item-actions {
    display: flex;
    gap: 4px;
    margin-left: 12px;
}

/* 标签页右键菜单样式 */
.tab-context-menu {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    min-width: 120px;
    padding: 4px 0;
    font-size: 13px;
}

.tab-context-menu-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    gap: 8px;
}

.tab-context-menu-item:hover:not(.disabled) {
    background-color: var(--bg-secondary);
}

.tab-context-menu-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tab-context-menu-item .menu-icon {
    width: 16px;
    text-align: center;
    font-size: 12px;
}

.tab-context-menu-item .menu-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-color);
}

.tab-context-menu-item.disabled .menu-text {
    color: var(--text-muted);
}

/* 签名配置样式 */
.signature-config {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.signature-config input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 13px;
    background: var(--bg-color);
    color: var(--text-color);
}

.signature-config input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.signature-config .btn {
    white-space: nowrap;
}

/* 签名配置区域样式 */
.signature-config-section {
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
}

.signature-config-toggle {
    margin-bottom: 8px;
}

.signature-config-toggle label {
    font-size: 13px;
    color: var(--text-secondary);
}

.signature-custom-config {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
}

.signature-custom-config .form-group {
    margin-bottom: 12px;
}

.signature-custom-config .form-group:last-child {
    margin-bottom: 0;
}

.signature-custom-config label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--text-color);
    font-weight: 500;
}

.signature-custom-config input,
.signature-custom-config textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.signature-custom-config textarea {
    resize: vertical;
    min-height: 80px;
}

.signature-custom-config input:focus,
.signature-custom-config textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}/* 空状态
样式 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    min-height: 200px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.empty-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 400px;
    margin-bottom: 20px;
}

.empty-state .btn {
    margin-top: 8px;
}

/* 历史记录面板和加载标签页面板宽度优化 */
.modal-dialog, .modal-content {
    width: 80vw;
    min-width: 400px;
    max-width: 1600px;
    max-height: 80vh; /* 限制模态框最大高度 */
}
@media (min-width: 1200px) {
    .modal-dialog, .modal-content {
        min-width: 800px;
        max-width: 1100px;
    }
}

/* 加载面板内容区域高度限制 */
.tab-files-tree {
    max-height: 60vh; /* 限制加载面板内容区域最大高度 */
    overflow-y: auto; /* 添加垂直滚动条 */
    padding-right: 8px; /* 为滚动条留出空间 */
}

/* 分组样式 */
.tab-group {
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
}

.tab-group-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
}

.tab-group-header:hover {
    background: var(--bg-tertiary);
}

.group-toggle {
    margin-right: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.group-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-color);
}

.group-count {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 8px;
}

.tab-group-content {
    max-height: 300px; /* 限制分组内容最大高度 */
    overflow-y: auto; /* 添加垂直滚动条 */
    background: var(--bg-color);
}

/* 快捷键列表样式 */
.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.shortcut-key {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.shortcut-desc {
    color: var(--text-color);
    font-size: 13px;
}

/* 环境选择器样式 */
.environment-selector {
    display: inline-flex;
    align-items: center;
    margin-right: 10px;
}

.env-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    min-width: 120px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.env-select:hover {
    border-color: var(--primary-color);
}

.env-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.env-select option {
    background: var(--bg-color);
    color: var(--text-color);
}

/* 暗色主题下的环境选择器 */
[data-theme="dark"] .env-select {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .env-select option {
    background: var(--bg-secondary);
}
.env-types-list, .projects-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.env-type-item, .project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.env-type-item:hover, .project-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.env-type-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.env-type-name {
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.env-type-display {
    color: var(--text-secondary);
    font-size: 13px;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-name {
    font-weight: 600;
    color: var(--text-color);
}

.project-context {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: var(--primary-color);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.project-environments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.env-tag {
    font-size: 11px;
    padding: 2px 6px;
    background: var(--success-color);
    color: white;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.env-type-actions, .project-actions {
    display: flex;
    gap: 6px;
}

.env-types-actions, .projects-actions {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.env-config-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.env-config-item label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 13px;
}

.env-config-item input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 13px;
}

.env-config-item input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px dashed var(--border-color);
}